library(readxl)
condition <- read_excel("~/Dropbox/NSC/Original Data/Competition 200106 Multi R Prediction.xlsx")
View(condition)
library(readxl)
original <- read_excel("~/Dropbox/NSC/Original Data/Competition 200106 Multi R Prediction.xlsx",
sheet = "decisions")
View(original)
original <- left_join(original,condition[,c("playerNr","role","onPage")],by = "playerNr")
original$subjectNr = as.factor(original$subjectNr)
original <- original %>%
filter(subjectNr !=0) %>%
filter(!is.na(age))
control <- original %>%
filter(role == 1 & period == 1)
nudge <- original %>%
filter(role == 2 & period == 1)
View(control)
View(original)
library(readxl)
original <- read_excel("~/Dropbox/NSC/Original Data/Competition 200106 Multi R Prediction.xlsx",
sheet = "decisions")
View(original)
original <- left_join(original,condition[,c("playerNr","role","onPage")],by = "playerNr")
original$subjectNr = as.factor(original$subjectNr)
original <- original %>%
filter(subjectNr !=0) %>%
filter(str_detect(onPage, "Ending|code"))
View(original)
control <- original %>%
filter(role == 1 & period == 1)
nudge <- original %>%
filter(role == 2 & period == 1)
View(control)
View(nudge)
table(nudge$winloss)
table(nudge$shouldcompete)
table(nudge$winloss/nrow(nudge))
table(nudge$winloss)
prop.table(nudge$winloss)
prop.table(nudge$winloss, 1)
prop.table(nudge$winloss, 2)
prop.table(nudge$winloss)
table(nudge$winloss)
nudge <- original %>%
filter(role == 2 & period == 2)
table(nudge$winloss)
nudge <- original %>%
filter(role == 2 & period == 3)
table(nudge$winloss)
nudge <- original %>%
filter(role == 2 & period == 4)
table(nudge$winloss)
nudge <- original %>%
filter(role == 2 & period == 5)
table(nudge$winloss)
table(nudge$shouldcompete)
nudge <- original %>%
filter(role == 2 & period == 1)
table(nudge$shouldcompete)
nudge <- original %>%
filter(role == 2 & period == 2)
table(nudge$shouldcompete)
71/106
nudge <- original %>%
filter(role == 2 & period == 3)
table(nudge$shouldcompete)
75/106
nudge <- original %>%
filter(role == 2 & period == 4)
table(nudge$shouldcompete)
75/106
nudge <- original %>%
filter(role == 2 & period == 5)
table(nudge$shouldcompete)
74/106
View(condition)
library(readxl)
Competition_191219_Basic_Effect_Pre_registration <- read_excel("~/Dropbox/NSC/Original Data/Competition 191219 Basic Effect Pre-registration.xlsx")
View(Competition_191219_Basic_Effect_Pre_registration)
table(Competition_191219_Basic_Effect_Pre_registration$onPage)
library(readxl)
condition <- read_excel("~/Dropbox/NSC/Original Data/Competition 191219 Basic Effect Pre-registration.xlsx")
View(condition)
library(readxl)
original <- read_excel("~/Dropbox/NSC/Original Data/Competition 191219 Basic Effect Pre-registration.xlsx",
sheet = "decisions")
View(original)
original <- left_join(original,condition[,c("playerNr","role","onPage")],by = "playerNr")
original$subjectNr = as.factor(original$subjectNr)
library(tidyverse)
library(stringr)
original <- left_join(original,condition[,c("playerNr","role","onPage")],by = "playerNr")
original$subjectNr = as.factor(original$subjectNr)
View(original)
nop <- original %>%
filter(subjectNr == 0)
table(nop$onPage)
nop <- original %>%
filter(subjectNr == 1)
table(nop$onPage)
nop <- original %>%
filter(subjectNr !=0)
table(nop$onPage)
122-115
13-7
12+14+24
115+7+12+2
115+7+12+2+24+49+10
View(condition)
library(readxl)
condition <- read_excel("~/Dropbox/NSC/Original Data/Competition 200101 China.xlsx")
View(condition)
table(condition)
table(condition$onPage)
64+76+11
library(readxl)
original <- read_excel("~/Dropbox/NSC/Original Data/Competition 200101 China.xlsx",
sheet = "decisions")
View(original)
original <- left_join(original,condition[,c("playerNr","role","onPage")],by = "playerNr")
original$subjectNr = as.factor(original$subjectNr)
nop <- original %>%
filter(subjectNr == 0)
table(nop$onPage)
64+30+14
p <- original %>%
filter(subjectNr>0)
nop <- original %>%
filter(subjectNr == 0 | is.na(subjectNR))
nop <- original %>%
filter(subjectNr == 0 | is.na(subjectNr))
table(nop)
table(nop$onPage)
94+14
p <- original %>%
filter(subjectNr > 0)
p <- original %>%
filter(subjectNr != 0 & !is.na(subjectNr))
table(p$onPage)
1+3
View(p)
25+5+11+10
25+1+10+5+11
220+52
220+52+124
length(is.na(condition$onPage))
length(is.na(condition$onPage) == 1)
table(is.na(condition$onPage) == 1)
110+245
675-245
91+122
96+4+110+124+104
table(p$onPage)
table(nop$onPage)
64+30+11+2
2+2
10+2+16+25
207+53
260+124
table(condition$onPage)
library(readxl)
original <- read_excel("~/Dropbox/NSC/Original Data/Competition 200101 China.xlsx",
sheet = "decisions")
View(original)
original <- left_join(original,condition[,c("playerNr","role","onPage")],by = "playerNr")
p <- original %>% filter(subjectNr !=0)
nop <- original %>% filter(subjectNr ==0)
205+180
View(condition)
table(original$onPage)
table(condition$onPage)
385+76
385+76-32
107+32+1
240+124+106
table(p$onPage)
table(nop$onPage)
25+1+10+2+5+11
100+140+54+1234
100+140+54+124
sum(table(p$onPage))
sum(table(nop$onPage))
76-32
45
385+45
180-124
56/2
205-96+2-2
109+45
154+54+100+124
100+152+54+124
library(readxl)
condition <- read_excel("~/Dropbox/NSC/Original Data/Competition 191104 Simplified 100 2 -5.xlsx")
View(condition)
table(is.na(condition$onPage))
library(readxl)
original <- read_excel("~/Dropbox/NSC/Original Data/Competition 191104 Simplified 100 2 -5.xlsx",
sheet = "decisions")
View(original)
original <- left_join(original,condition[,c("playerNr","role","onPage")],by = "playerNr")
View(original)
original <- original %>%
ss
nop <- original %>%
filter(subjectNr == 0)
p <- original %>% filter(subjectNr !=0)
View(nop)
table(nop)
table(nop$onPage)
2+4+9
View(p)
table(distinct(p[,c("playerNr", "onPage")]))
table(distinct(p[,c("playerNr", "onPage")])$onPage)
7+17+15+18+120
library(readxl)
condition <- read_excel("~/Dropbox/NSC/Original Data/Competition 200106 Multi R Prediction.xlsx")
View(condition)
table(is.na(condition$onPage))
library(readxl)
original <- read_excel("~/Dropbox/NSC/Original Data/Competition 200106 Multi R Prediction.xlsx",
sheet = "decisions")
View(original)
original <- left_join(original,condition[,c("playerNr","role","onPage")],by = "playerNr")
table(condition$onPage == "lobby" | nop == "Ending|Code")
table(condition$onPage == "filter")
table(condition$onPage == "lobby" | nop == "Ending|Code")
table(condition$onPage == "lobby" | nop$onPage == "Ending|Code")
table(nop$onPage)
View(nop)
nop$onPage == "Ending|Code"
table(condition$onPage == "lobby" | nop$onPage == "Ending Code")
?
str_detect
table(condition$onPage == "lobby" | str_detect(nop$onPage, "Ending|Code"))
str_detect(nop$onPage, "Ending|Code")
table(str_detect(nop$onPage, "Ending|Code"))
table(condition$onPage == "lobby")
table(str_detect(condition$onPage, "lobby") | str_detect(nop$onPage, "Ending|Code"))
table(str_detect(nop$onPage, "Ending|Code"))
table(str_detect(condition$onPage, "lobby"))
table(nop$onPage)
6+7+2
table(distinct(p[,c("PlayerNr", "onPage")])$onPage)
table(distinct(p[,c("playerNr", "onPage")])$onPage)
library(readxl)
X2A <- read_excel("~/Downloads/2A-73.xlsx")
View(X2A)
cor.test(X2A$prediction, X2A$choice)
prediction <- X2A %>%
filter(condition = "prediction")
library(tidyverse)
prediction <- X2A %>%
filter(condition = "prediction")
prediction <- X2A %>%
filter(str_detect(condition, "prediction"))
tip <- X2A %>%
filter(str_detect(condition, "tip"))
cor.test(prediction$prediction, prediction$choice)
cor.test(tip$prediction, tip$choice)
library(readxl)
tip <- read_excel("~/Downloads/2A-75.xlsx")
View(tip)
cor.test(tip$tippre, tip$tipde)
cor.test(tip$pre, tip$de)
library(readxl)
risk <- read_excel("~/Dropbox/Risk - 4.xlsx")
View(risk)
tapply(risk$Guilt, risk$Context, mean)
tapply(risk$Shame, risk$Context, mean)
tapply(risk$Shame, list(risk$Context, risk$emo), mean)
ggplot(risk, aes(x = Context, y = Shame, fill = emo)) +
geom_bar()
library(tidyverse)
library(plyr)
library(Hmisc)
library(afex)
library(reshape)
ggplot(risk, aes(x = Context, y = Shame, fill = emo)) +
geom_bar()
ggplot(risk, aes(x = Context, y = Shame, fill = emo)) +
geom_col()
ggplot(risk, aes(x = Context, y = Shame, fill = emo)) +
geom_bar(position="dodge", stat="identity")
ggplot(risk, aes(x = Context, y = Shame, fill = emo)) +
geom_bar(position="dodge")
ggplot(risk, aes(x = Context, y = Shame, fill = emo)) +
geom_col(position="dodge")
aggregate(risk$Guilt, list(risk$Context, risk$emo), mean)
new <- aggregate(risk$Guilt, list(risk$Context, risk$emo), mean)
names(new) = c("context", "emo","guilt")
ggplot(new, aes(x = context, y = guilt, fill = emo)) +
geom_col(position="dodge")
risk <- gather(risk, key = measureemo, value = rating, Guilt, Shame, Anxiety, Fear, Happy, Excited)
View(risk)
new <- aggregate(risk$rating, list(risk$Context, risk$emo, risk$measureemo), mean)
View(new)
names(new) = c("context", "condition","emo")
names(new)[4] = mean
names(new)[4] = "mean"
ggplot(new, aes(x = context, y = rating, fill = condition)) +
geom_col(position="dodge") +
facet_wrap(~emo)
View(new)
ggplot(new, aes(x = context, y = mean, fill = condition)) +
geom_col(position="dodge") +
facet_wrap(~emo)
new <- new %>%
filter(condition == "fear" | condition== "shame")
View(new)
ggplot(new, aes(x = context, y = mean, fill = condition)) +
geom_col(position="dodge") +
facet_wrap(~emo)
10*1+5*(-2)
10*1+5*(-1)
5*1 + 10*(-1)
10 + -3*5
-3*5+5
library(readxl)
condition <- read_excel("~/Dropbox/NSC/Original Data/Competition 200307 NSC vs RPD Infinite Preregiestered 60s 27R.xlsx")
View(condition)
library(readxl)
LIONESS_Results_Competition_200306_NSC_vs_RPD_Infinite_Preregiestered_copy_20200310_1907 <- read_excel("~/Downloads/LIONESS Results - Competition 200306 NSC vs RPD Infinite Preregiestered (copy) 20200310_1907.xlsx",
sheet = "decisions")
View(LIONESS_Results_Competition_200306_NSC_vs_RPD_Infinite_Preregiestered_copy_20200310_1907)
o <- read_excel("~/Downloads/LIONESS Results - Competition 200306 NSC vs RPD Infinite Preregiestered (copy) 20200310_1907.xlsx",
sheet = "decisions")
View(LIONESS_Results_Competition_200306_NSC_vs_RPD_Infinite_Preregiestered_copy_20200310_1907)
View(o)
o <- o %>%
filter(subjectNr != 0)
library(tidyverse)
o <- o %>%
filter(subjectNr != 0)
library(readxl)
con <- read_excel("~/Downloads/LIONESS Results - Competition 200306 NSC vs RPD Infinite Preregiestered (copy) 20200310_1907.xlsx")
View(con)
o <- left_join(o, con)
View(o)
o <- read_excel("~/Downloads/LIONESS Results - Competition 200306 NSC vs RPD Infinite Preregiestered (copy) 20200310_1907.xlsx",
sheet = "decisions")
View(LIONESS_Results_Competition_200306_NSC_vs_RPD_Infinite_Preregiestered_copy_20200310_1907)
rm(list = ls())
o <- read_excel("~/Downloads/LIONESS Results - Competition 200306 NSC vs RPD Infinite Preregiestered (copy) 20200310_1907.xlsx",
sheet = "decisions")
library(readxl)
con <- read_excel("~/Downloads/LIONESS Results - Competition 200306 NSC vs RPD Infinite Preregiestered (copy) 20200310_1907.xlsx")
View(con)
original <- left_join(o,con[,c("playerNr","role","onPage")],by = "playerNr")
View(original)
original$subjectNr = as.character(original$subjectNr)
original <- original %>%
filter(subjectNr !=0)
View(original)
View(original)
con <- original %>%
filter(role == 1)
View(con)
library(readxl)
library(psych)
library(tidyverse)
library(tidytext)
library(textdata)
product_pretest <- read_excel("~/Desktop/Disconfirmation - Pretest.xlsx", sheet = "Product knowledge",
col_types = c("text", "numeric", "numeric", "numeric", "text", "numeric",
"numeric", "numeric", "numeric", "numeric", "text"))
brand_pretest <- read_excel("~/Desktop/Disconfirmation - Pretest.xlsx", sheet = "Brands")
# alpha
a1 <- alpha(product_pretest[,c("knowledgeable", "familiar", "frequently")], na.rm = TRUE)
summary(a1)
product_pretest <- product_pretest %>%
mutate(productknowledge = (knowledgeable+familiar+frequently)/3)
# brand category
never_heard <- unnest_tokens(brand_pretest[, c("ResponseId", "product category", "never heard of")],
output = brand, input = `never heard of`, token = "words") %>%
mutate(state = "never heard")
heardnouse <- unnest_tokens(brand_pretest[, c("ResponseId", "product category", "heard of but never used")],
output = brand, input = `heard of but never used`, token = "words") %>%
mutate(state = "heard not used")
use <- unnest_tokens(brand_pretest[, c("ResponseId", "product category", "used")],
output = brand, input = used, token = "words") %>%
mutate(state = "used")
brand <- bind_rows(never_heard, heardnouse, use)
ssize <- brand_pretest %>%
count(`product category`)
names(ssize)[2] = "totaln"
brand_freq <- brand %>%
count(state,`product category`,brand) %>%
group_by(state,`product category`) %>%
arrange(n) %>%
filter(!is.na(brand)) %>%
left_join(ssize) %>%
mutate(prop = n/totaln)
ggplot(brand_freq, aes(x = brand, y = prop, fill=state))+
geom_col(position = "dodge") +
facet_wrap(~`product category`, scales = "free_y") +
coord_flip()
productbuy <- unnest_tokens(product_pretest[, c("ResponseId", "product", "plan")],
output = plan, input = plan, token = "words")
ssize <- product_pretest %>%
count(product)
names(ssize)[2] = "totaln"
product_freq <- productbuy %>%
count(product, plan) %>%
group_by(product) %>%
arrange(n) %>%
left_join(ssize) %>%
mutate(prop = n/totaln)
ggplot(product_freq, aes(x = product, y = prop, fill=plan))+
geom_col(position = "dodge") +
theme(axis.text.x = element_text(angle = 30))
mean1 <- aggregate(product_pretest$knowledgeable, list(product_pretest$product), mean)
mean2 <- aggregate(product_pretest$productknowledge, list(product_pretest$product), mean)
mean3 <- aggregate(product_pretest$care, list(product_pretest$product), mean)
View(mean1)
a1 <- alpha(product_pretest[,c("knowledgeable", "familiar", "frequently")], na.rm = TRUE)
summary(a1)
a1 <- alpha(product_pretest[,c("knowledgeable", "familiar", "frequently")])
summary(a1)
product_pretest <- product_pretest %>%
mutate(productknowledge = (knowledgeable+familiar+frequently)/3)
knowledgeable <- aggregate(product_pretest$knowledgeable, list(product_pretest$product), mean)
productknowledge <- aggregate(product_pretest$productknowledge, list(product_pretest$product), mean)
care <- aggregate(product_pretest$care, list(product_pretest$product), mean)
View(knowledgeable)
knowledgeable <- aggregate(product_pretest$knowledgeable, list(product_pretest$product), sd)
knowledgeable <- aggregate(product_pretest$knowledgeable, list(product_pretest$product), mean)
productknowledge <- aggregate(product_pretest$productknowledge, list(product_pretest$product), mean)
t.test((product_pretest %>% filter(product == "TV"))$knowledgeable, (product_pretest %>% filter(product == "Espresso machine"))$knowledgeable)
care <- aggregate(product_pretest$care, list(product_pretest$product), mean)
View(care)
cor.test(product_pretest$knowledgeable, product_pretest$care)
t.test((product_pretest %>% filter(product == "Pots and pans"))$care, mu = 3.5)
t.test((product_pretest %>% filter(product == "Pots and pans"))$care, mu = 4)
t.test((product_pretest %>% filter(product == "Electric toothbrush"))$care, mu = 4)
productknowledge <- aggregate(product_pretest$productknowledge, list(product_pretest$product), mean)
View(productknowledge)
names(productknowledge)=c("product", "know")
names(care)= c("product","care")
comb <- left_join(productknowledge, care)
View(comb)
names(knowledgeable) = c("product", "knowledgeable")
comb <- left_join(comb, knowledgeable)
t.test((product_pretest %>% filter(product == "Printer"))$care, (product_pretest %>% filter(product == "Smart home device"))$care)
consumerreview <- aggregate(product_pretest$consumerreview, list(product_pretest$product), mean)
View(consumerreview)
consumerreview <- aggregate(product_pretest$consumerreview, list(product_pretest$product), mean)
manu <- aggregate(product_pretest$manufacture_info, list(product_pretest$product), mean)
blogger <- aggregate(product_pretest$bloggerreview, list(product_pretest$product), mean)
sponsor <- aggregate(product_pretest$likelysponsor, list(product_pretest$product), mean)
names(consumerreview) = c("product", "consumerreview")
names(manu) = c("product", "manu")
names(blogger) = c("product", "blogger")
names(sponsor) = c("product", "sponsor")
comb <- left_join(consumerreview, manu, blogger, sponsor)
comb <- left_join(consumerreview, manu, blogger, sponsor, by = "product")
View(sponsor)
View(ssize)
View(sponsor)
View(manu)
View(blogger)
comb <- left_join(consumerreview, manu)
comb <- left_join(comb, blogger)
comb <- left_join(comb, sponsor)
View(comb)
t.test((product_pretest %>% filter(product == "Luggage"))$bloggerreview, (product_pretest %>% filter(product == "Digital camera"))$bloggerreview)
t.test((product_pretest %>% filter(product == "TV"))$bloggerreview, (product_pretest %>% filter(product == "Digital camera"))$bloggerreview)
t.test((product_pretest %>% filter(product == "TV"))$likelysponsor, (product_pretest %>% filter(product == "Smart home device"))$likelysponsor)
brand_pretest <- read_excel("~/Desktop/Disconfirmation - Pretest.xlsx", sheet = "Brands")
never_heard <- unnest_tokens(brand_pretest[, c("ResponseId", "product category", "never heard of")],
output = brand, input = `never heard of`, token = "words") %>%
mutate(state = "never heard")
heardnouse <- unnest_tokens(brand_pretest[, c("ResponseId", "product category", "heard of but never used")],
output = brand, input = `heard of but never used`, token = "words") %>%
mutate(state = "heard not used")
use <- unnest_tokens(brand_pretest[, c("ResponseId", "product category", "used")],
output = brand, input = used, token = "words") %>%
mutate(state = "used")
brand <- bind_rows(never_heard, heardnouse, use)
ssize <- brand_pretest %>%
count(`product category`)
names(ssize)[2] = "totaln"
brand_freq <- brand %>%
count(state,`product category`,brand) %>%
group_by(state,`product category`) %>%
arrange(n) %>%
filter(!is.na(brand)) %>%
left_join(ssize) %>%
mutate(prop = n/totaln)
ggplot(brand_freq, aes(x = brand, y = prop, fill=state))+
geom_col(position = "dodge") +
facet_wrap(~`product category`, scales = "free_y") +
coord_flip()
View(comb)
View(knowledgeable)
151
151+118+101+302+100+112+314+450+299+212
setwd("~/Dropbox/Two Accounts/Data and Results/Data MS")
library(readxl)
Study_6_o16 <- read_excel("~/Dropbox/Two Accounts/Data and Results/Data MS/Study 6-o16.xlsx")
View(Study_6_o16)
data <- Study_6_o16
table(data$"AirPassengers")
data <- Study_6_o16
table(data$"AirPassengers")
table(data$"women")
d<-Study_6_o16
table(d$`Other Level`)/length(d$`Other Level`)
table(d$`Self Level`)/length(d$`Self Level`)
table(d$`Self Level`)
length(d$`Self Level`)-55
length(d$`Self Level`)-18
18/(18+94)
